package algo.math.evaluator.value;

import algo.math.evaluator.base.IBase;
import algo.math.evaluator.base.exceptions.UnrecognizedToken;

/**
 * Represent a value.
 */
public interface IValue {

	/**
	 * Output of the compare method.
	 */
	public static enum Compare
	{
		
		/** The EQUALS. */
		EQUALS,
		
		/** The SUPERIOR. */
		SUPERIOR,
		
		/** The INFERIOR. */
		INFERIOR
	}
	
	/** Unary negative operator */
	public static char NEGATIVE_VALUE = '-';
	
	/**
	 * Gets the size of the decimal part.
	 *
	 */
	IValue getSizeOfDecimal (); 
	
	/**
	 * Gets the integer value.
	 *
	 */
	String getIntegerValue ();
	
	/**
	 * Gets the decimal value.
	 *
	 */
	String getDecimalValue ();
	

	String toString ();
	
	/**
	 * Checks if is negative.
	 *
	 */
	Boolean isNegative();
	
	/**
	 * Sets the is negative.
	 *
	 */
	void SetIsNegative(boolean negative);
	
	/**
	 * Gets the number base associated with the value.
	 *
	 */
	IBase getBase();
	
	Compare compareTo(IValue value);
	
	/**
	 * Checks if is zero.
	 *
	 */
	Boolean isZero();
	
	/**
	 * Gets the buffer, if exist, created during the evaluation.
	 *
	 */
	String getBuffer();
	
	/**
	 * Set the buffer, if exist, created during the evaluation.
	 *
	 */
	void setBuffer (String buffer);
	
	/**
	 * Checks if is buffered.
	 *
	 * @return the boolean
	 */
	Boolean isBuffered();
	
	/**
	 * Sets the value.
	 *
	 */
	void setValue (String value, IBase base) throws UnrecognizedToken;
	
	/**
	 * Normalize the value.
	 *
	 */
	String normalize (String value) throws UnrecognizedToken;
}
